// This sample program demonstrates how to use the base log package.
package main

import (
	"log"
)

func init() { //MARK 日志配置, 这是在一个全局公用的log上配置
	log.SetPrefix("TRACE: ")                                    //MARK 前缀大写
	log.SetFlags(log.Ldate | log.Lmicroseconds | log.Llongfile) //MARK 这3个标志取|就是都要: 本地日期 毫秒 哪行
}

func main() {
	// Println writes to the standard logger.
	log.Println("message")

	//MARK  Fatalln is Println() followed by a call to os.Exit(1).
	log.Fatalln("fatal message")

	//MARK Panicln is Println() followed by a call to panic().
	log.Panicln("panic message")

	/**
	TRACE: 2021/08/17 D:/learm/code/chapter8/listing03/listing03.go:21: panic message     <-panic日志
	panic: panic message                                                                  <- 触发的panic


	goroutine 1 [running]:
	log.Panicln(0xc0000d7f68, 0x1, 0x1)
		D:/Program Files/Go/src/log/log.go:368 +0xb7
	main.main()
		D:/learm/code/chapter8/listing03/listing03.go:21 +0xa8
	*/
}
